﻿@{
    ViewBag.Title = "Menu";
    Layout = "~/Views/Shared/_LayoutPageAll.cshtml";
}
李聪 2017/4/25 13:53:51
<script src="~/js/jquery-1.8.2.js"></script>
<script src="~/Commom/Waterfall/js/jquery-1.8.3.min.js"></script>
<script src="~/Commom/Waterfall/js/waterfall.js"></script>
<style type="text/css">
    * {
        padding: 0;
        margin: 0;
                    }
</style>

<script>
    //添加购物车
    function fun(n)
    {
        var id=@Session["UserID"];
        $.ajax({
            type:'get',
            url:'http://localhost:19451/api/menu/GetMenuIdshow',
            data:{
                id:n,
            },
            success:function(data){
                if(data==""){
                    alert("");
                }
                else
                {
                    var arr=JSON.parse(data);
                    $(arr).each(function(i,obj){
                          $.ajax({
                            type: "Get", //访问WebService使用Post方式请求
                            url: "http://localhost:19451/api/menu/getaddcar",
                            data:{
                                CarId:obj.MenuId,
                                CarName:obj.MenuName,
                                CarPhoto:obj.MenuPhoto,
                                CarDescrib:obj.MenuDescrib,
                                CarPrice:obj.MenuPrice,
                                CarNum:1,
                                UserId:id,
                            },
                            success: function (response) { //回调函数，result，返回值

                          
                                if(response==1)
                                {
                                    alert('添加成功');
                                }
                                else if(response==2)
                                {
                                    alert('添加成功');
                                }
                                else
                                {                             
                                    alert('没有此菜品');
                                }
                            }
                        })

                    })


                }
            }
        })
        
    }

</script>
<a href="/Home/Shopping">我的订单</a>
@*页面中心内容*@
<div class="content clearfix">
    <div class="breadcrumbs">
        <h2 class="element-invisible">You are here</h2><div class="breadcrumb"><a href="/">返回主页</a> » 菜&nbsp;&nbsp;&nbsp;单 </div>
    </div>

    <div id="content" class="column content-inner">
        <div class="section">
            <a id="main-content"></a>
            <div class="region region-content">
                <div id="block-system-main" class="block block-system">
                    <div class="content">
                        <div class="product-menu-header">
                            <h2>Menu</h2>
                        </div>
                        <div id="main" class="product-menu-holder">
                            <div>
                                @Html.Raw(ViewBag.Menu)
                            </div>
                   
                          
                            </div>
                        <input type="text" hidden="hidden" id="waterfall" value="6" />

                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


